@extends('public.home_base')
@section('title', '待处理工单')

@section('content')
    @parent
    <div class="w1200 auto gd_system">
        <div class="tabout">
            <ul class="gd_tab">
                <li><a href="gongdan">提交工单</a></li>
                <li class="tab_active"><a href="dgongdan">待处理工单</a><i title="当前有{{$data->total()}}个工单待处理">{{$data->total()}}</i></li>
                <li><a href="gdlist">所有工单</a></li>
            </ul>
        </div>

        <div class="con_out clearfix">
            <div class="gd_mytable ">

                <div class="btnviewed fr">

                </div>

                <form name="winform" id="winform" onsubmit="return false;">
                    <input type="hidden" name="act" value="mylist">
                    <input type="hidden" name="pageno" value="1">
                    <input type="hidden" name="module" value="1">
                    <div class="gd_search">关键词搜索<input type="text" name="word" class="inputtext" placeholder="请输入关键字">
                        <input type="button" value="查 询" class="smallbtn" onclick="LoadJsonData()"></div>
                </form>
                <div class="clear"></div>

                <table class="question_table">
                    <thead>
                    <tr>
                        <th>工单号</th>
                        <th>问题标题</th>
                        <th>处理状态</th>
                        <th>问题时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody id="datalist">
                    @forelse($data as $item)
                        <tr>
                            <td>{{$item->id}}</td>
                            <td>
                                <div class="question_link">
                                    <a href="gdinfo?gdh={{$item->id}}" class="boldlink">{{$item->title}}</a>
                                </div>
                            </td>
                            <td>
                                @if($item->status===0)<span class="question_zt ztbg2"> <span class="autotip">待处理</span></span>
                                @elseif($item->status>0)<span class="question_zt ztbg61"> <span
                                            class="autotip">已处理</span></span>
                                @endif
                            </td>
                            <td>{{$item->created_at}}</td>
                            <td>
                                <div class="tleft">
                                    <a href="gdinfo?gdh={{$item->id}}"class="yd_link">查看</a>&nbsp;&nbsp;&nbsp;
                                </div>
                            </td>
                        </tr>
                    @empty
                        <tr>
                            <td colspan="5" style="padding: 50px;">没有数据</td>
                        </tr>
                    @endforelse
                    </tbody>
                </table>
                <div class="pagelist" id="pagelist"><span>共{{$data->total()}}条</span>
                    @if($data->onFirstPage())
                        <a href="javascript:void(0)" style="pointer-events: none">首页</a>
                        <a href="javascript:void(0)" style="pointer-events: none">上一页</a>
                    @else
                        <a href="{{$data->url(1)}}">首页</a>
                        <a href="{{$data->previousPageUrl()}}">上一页</a>
                    @endif
                    <a href="javascript:void(0)" class="active_page">{{$data->currentPage()}}</a>

                    @if($data->hasMorePages())
                        <a href="{{$data->nextPageUrl()}}">下一页</a>
                        <a href="{{$data->url($data->lastPage())}}">末页</a>
                    @else
                        <a href="javascript:void(0)" style="pointer-events: none">下一页</a>
                        <a href="javascript:void(0)" style="pointer-events: none">末页</a>
                    @endif
                </div>
            </div>
        </div>
    </div>
@endsection
@section('script')
    <script>
        function view(){
            layer.open({
                skin: 'layui-layer-rim', //加上边框
                type: 2,
                title: '查看信息',
                shadeClose: true,
                shade: 0.8,
                area: ['800px', '480px'], //宽高
                content: '/' //iframe的url
            });
        }
    </script>
@endsection